import Data.Bits
import Control.Monad

maximizingXOR :: Int -> Int -> Int
maximizingXOR i j = foldl1 (max) xorList
    where list = [i..j]
          xorList = [x `xor` y | x <- list, y <- list]

main = do
    i <- readLn
    j <- readLn
    print $ maximizingXOR i j 